package com.bage.finance.biz.service;

import com.bage.finance.biz.dto.form.*;
import com.bage.finance.biz.dto.vo.ListFileVo;
import com.bage.mybatis.help.PageInfo;
import io.minio.errors.*;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.List;

public interface FileService {
    /**
     * 查询文件列表
     * @param form
     * @return
     */
    PageInfo<ListFileVo> list(ListFileForm form) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;

    /**
     * 统计某个文件夹文件的数量
     * @param folderId
     * @return
     */
    int countByFolderId(Long folderId);

    /**
     * 获取图片url
     * @param id
     * @return
     */
    String getPicUrl(Long id) throws Exception;

    /**
     * 删除图片
     * @param form
     * @return
     */
    Boolean del(DelForm form);

    /**
     * 查询文件列表
     * @param form
     * @return
     */
    List<ListFileVo> listByIds(ListFileByIdsForm form) throws Exception;

    /**
     * 分片上传文件
     * @param form
     * @return
     */
    String uploadPart(UploadFileForm form) throws Exception;

    /**
     * 合并上传后的文件
     * @param form
     * @return
     */
    String composeFile(ComposeFileForm form);
}
